import http from '@/server'

export async function getStaffInfo(params: Staff.StaffListParams) {
    return http.request({
      url: '/account/info',
      method: 'post',
      headers: {
        'Content-Type': 'application/json', // 设置为 application/json
      },
      data: params, // 使用 data 代替 params，将参数作为请求体传递
    });
}

// 修改密码
export async function resetStaffPwd(data?: Staff.StaffListParams) {
    return http.request({
      url: '/account/change_password',
      method: 'post',
      headers: {
        'Content-Type': 'application/json', 
      },
      data
    })
}

export async function updateStaffInfo(params: Staff.StaffListParams) {
    return http.request({
      url: '/account/update',
      method: 'post',
      headers: {
        'Content-Type': 'application/json', 
      },
      data: params, 
    });
}

export async function forbiddenStaff(params: Staff.StaffListParams) {
    return http.request({
      url: '/account/disable',
      method: 'post',
      headers: {
        'Content-Type': 'application/json', 
      },
      data: params, 
    });
}

export async function addStaff(params: Staff.StaffListParams) {
    return http.request({
      url: '/account/add_admin',
      method: 'post',
      headers: {
        'Content-Type': 'application/json', 
      },
      data: params, 
    });
}

export async function deleteStaff(params: Staff.StaffListParams) {
    return http.request({
      url: '/account/delete',
      method: 'post',
      headers: {
        'Content-Type': 'application/json', 
      },
      data: params, 
    });
}


